\subsection{Course description}
The course consists of four parts.
\begin{enumerate}
    \item The theory of sheaves on topological spaces.
    \item The definitions of schemes and morphisms between them.
    \item Properties of schemes, such as the algebraic geometry analogues of compactness and other similar properties.
    \item Rapid introduction to the cohomology of sheaves.
\end{enumerate}

\subsection{Motivation from moduli theory}
In moduli theory, we study families of varieties instead of one at a time.
In the extreme, we study all varieties of a given `type' simultaneously.
For now, let
\[ \mathbb P^n = \mathbb P^n_{\mathbb C} = \faktor{\mathbb C^{n+1} \setminus \qty{\vb 0}}{\sim} \]
where \( \vb x \sim \lambda \vb x \) for nonzero \( \lambda, \vb x \).
A variety is the vanishing locus \( \mathbb V(S) \) of a set \( S \) of homogeneous polynomials in \( n + 1 \) variables.
These are subsets of \( \mathbb P^n \).
We present some examples of moduli.
\begin{example}
    The set of all lines in \( \mathbb P^2 \).
    A line in \( \mathbb P^2 \) is given by
    \[ \qty{aX_0 + bX_1 + cX_2 = 0} \]
    where not all of \( a, b, c \) are zero.
    The set of all lines in \( \mathbb P^2 \) are given by triples \( (a, b, c) \).
    Note that \( (\lambda a, \lambda b, \lambda c) \) gives the same line as \( (a, b, c) \), so really lines in \( \mathbb P^2 \) correspond exactly to points in \( \mathbb P^2 \).
    We call the set of all lines in \( \mathbb P^2 \) the dual space \( \mathbb P^2_{\text{dual}} \).
    This property is known as projective duality.

    The same logic applies to the set of degree \( d \) hypersurfaces in \( \mathbb P^n \); this space corresponds directly to
    \[ \mathbb P^{\binom{n+d}{d} - 1} \]
\end{example}
There is an unfortunate consequence of this method of study.
Some polynomials are of the form \( f = f_1^2 f_2 \) for some non-constant \( f_1 \), but then \( \mathbb V(f) = \mathbb V(f_1 f_2) \).
For example, \( (X_0 + X_1 + X_2)^2 \subseteq \mathbb P^2 \) is a line not a conic.
In particular, the limit of a sequence of conics may not be a conic.
The solution is to take the set
\[ U_d \subseteq \mathbb P^{\binom{n+d}{d} - 1} \]
in which \( [f] \in U_d \) has no repeated factors.
But then, \( U_d \) is `not compact', as some points have been removed.

We will now describe the impact of scheme theory on this situation.
Fix some \( \mathbb P^n \), and we will produce a `space'
\[ \operatorname{Var}(\mathbb P^n) \subsetneq \operatorname{Hilb}(\mathbb P^n) \]
The set \( \operatorname{Var}(\mathbb P^n) \) bijects onto the set of varieties of \( \mathbb P^n \).
The set \( \operatorname{Hilb}(\mathbb P^n) \) bijects onto the set of subschemes of \( \mathbb P^n \), and is compact in the Euclidean topology.
In particular, limits of varieties need not be varieties, but limits of schemes are always schemes.
One consequence is that in scheme theory,
\[ \mathbb V(X_0 + X_1 + X_2),\quad \mathbb V((X_0 + X_1 + X_2)^2) \]
are not isomorphic as schemes in \( \mathbb P^2 \).

\subsection{Motivation from the Weil conjectures}
Fix some homogeneous polynomial \( f \in \mathbb Z[X_0, \dots, X_{n+1}] \).
First, consider
\[ X = \mathbb V(f) \subseteq \mathbb P^{n+1}_{\mathbb C} \]
and assume that \( X \) is smooth.
As \( X \) is a compact topological space, we can find its Betti numbers \( b_0(X), \dots, b_{2n}(X) \), where
\[ b_i(X) = \operatorname{rank} H_i(X; \mathbb Z) \]
In particular, we can find its Euler characteristic.
\[ \chi(X) = \sum (-1)^i b_i(X) \]
Second, fix a prime \( p \) and let \( N_m \) be the number of solutions of \( f \) over \( \mathbb F_{p^m} \).
Define the Weil zeta function
\[ \zeta(X;t) = \exp(\sum_m \frac{N_m}{m} \cdot t^m) \]
One of the Weil conjectures states the following.
\begin{theorem}[Grothendieck]
    \begin{enumerate}
        \item \( \zeta(X; t) \) is a rational function in \( t \), so
        \[ \zeta(X; t) = \frac{P_X(t)}{Q_X(t)} \]
        \item Further, \( \zeta(X; t) \) can be written as a ratio of the form
        \[ \frac{P_0(t) P_2(t) \dots P_{2n}(t)}{P_1(t) P_3(t) \dots P_{2n-1}(t)} \]
        where
        \[ \deg P_i(t) = b_i(X) \]
    \end{enumerate}
\end{theorem}
The proof relies fundamentally on scheme theory: we need a space \( \mathcal X \) that interpolates between the algebraic closure \( \overline{\mathbb F_p} \) and \( \mathbb C \).

\subsection{Summary of classical algebraic geometry}
Let \( k = \overline k \) be an algebraically closed field.
The notation \( \mathbb A^n_k = \mathbb A^n \) denotes affine space of dimension \( n \) over the field \( k \).
As a set, this is equal to \( k^n \).
An \emph{affine variety} is a subset \( V \subseteq \mathbb A^n \) of the form
\[ V = \mathbb V(S) = \qty{x \in \mathbb A^n \mid \forall f \in S,\, f(x) = 0} \]
where \( S \subseteq k[X_1, \dots, X_n] \).
Note that \( \mathbb V(S) = \mathbb V(I(S)) \), where \( I(S) \) is the ideal generated by \( S \).
By Hilbert's basis theorem, or equivalently the fact that \( k[\vb X] \) is Noetherian, \( \mathbb V(S) \) is the vanishing locus of a finite set (even a finite subset of \( S \)).
In fact, \( \mathbb V(I) = \mathbb V\qty(\sqrt{I}) \) where
\[ \sqrt{I} = \qty{f \in k[\vb X] \mid \exists n > 0,\, f^n \in I} \]
Note that \( \sqrt{I} \) is an ideal, and is called the \emph{radical ideal} of \( I \).
For example, in \( k[X] \), if \( I = (X^2) \) then \( \sqrt{I} = (X) \).
Notice that an affine variety is a subset of \( \mathbb A^n \) for some \( n \), so we have really defined varieties with a chosen \( n \); we have not defined an abstract variety.

A \emph{morphism} between varieties \( V \subseteq \mathbb A^n \) and \( W \subseteq \mathbb A^m \) is a set-theoretic map \( \varphi : V \to W \) such that if \( \varphi(f_1, \dots, f_m) \), each \( f_i \) is the restriction of a polynomial in \( \qty{X_1, \dots, X_n} \) to \( V \).
Note that the polynomials \( f_i \) are not part of the definition; a given set-theoretic map may be represented by multiple polynomials.
This indicates that the ambient spaces \( \mathbb A^n, \mathbb A^m \) are not relevant to this definition.
Isomorphisms are those morphisms with two-sided inverses.

The basic correspondence of the theory of algebraic varieties is
\[ \frac{\qty{\text{affine varieties over } k}}{\text{isomorphism}} \leftrightarrow \qty{\text{finitely generated \( k \)-algebras without nilpotent elements}} \]
We explain each direction of the correspondence.
Given a variety \( V \) representing an isomorphism class of affine varieties over \( k \), we can write \( V \) as the vanishing locus of some radical ideal \( I \subseteq k[X_1, \dots, X_n] \).
We can then produce the finitely generated \( k \)-algebra given by the quotient
\[ \faktor{k[X_1, \dots, X_n]}{I} \]
This is nilpotent-free as \( I \) is radical.
In reverse, if \( A \) is a finitely generated nilpotent-free \( k \)-algebra, then by definition we can write \( A \) as
\[ \faktor{k[Y_1, \dots, Y_m]}{J} \]
where \( J \) is radical, or at least up to isomorphism.
Then we can produce the affine variety \( V = \mathbb V(J) \).
One must show that the choices we made in the above explanation do not matter.

Note that, for example, \( \faktor{k[X]}{(X^2)} \) has a nilpotent element \( X \).
The theory of schemes explains the relevance of these nilpotent elements, but the theory of varieties `ignores' nilpotent elements.

The algebra associated to \( V \) is classically denoted \( k[V] \), and is called the \emph{coordinate ring} of \( V \).
There is a bijection between morphisms \( V \to W \) and \( k \)-algebra homomorphisms \( k[W] \to k[V] \).
In category theoretic terminology, the category whose objects are affine varieties up to isomorphism is equivalent to the category of finitely generated \( k \)-algebras up to isomorphism.

Let \( V = \mathbb V(I) \subseteq \mathbb A^n \) be a variety with coordinate ring \( k[V] \).
The \emph{Zariski} topology on \( V \) is defined such that the closed sets are exactly those sets of the form \( \mathbb V(S) \) where \( S \subseteq k[V] \).
One can show that this really induces a topology.
If \( V \cong W \), then \( V \) and \( W \) are homeomorphic as topological spaces.

Let \( V \) be a variety and \( k[V] \) be its coordinate ring.
For all points \( P \in V \), we can produce a homomorphism \( \mathrm{ev}_P : k[V] \to k \) mapping \( f \) to \( f(P) \); one can check that this is well-defined.
Note that \( \mathrm{ev}_P \) is surjective by considering the constant functions.
Thus the kernel of \( \mathrm{ev}_P \) is a maximal ideal \( \mathfrak m_P \).
We thus obtain
\[ \qty{\text{points of } V} \to \qty{\text{maximal ideals in } k[V]} \]
Hilbert's \emph{Nullstellensatz} states, among other things, that this is a bijection.

\subsection{Limitations of classical algebraic geometry}
The description of varieties given above always retains information about its ambient affine space, so we cannot define an abstract variety.
Similarly to manifolds which locally look like vector spaces, we want to consider `spaces' that locally look like affine varieties.
For example, projective space does not live inside an affine space.

Let \( I = (X^2 + Y^2 + 1) \subseteq \mathbb R[X, Y] \).
Observe that \( \mathbb V(I) \) is empty in \( \mathbb R^2 \), but \( I \) is prime and hence radical.
Hence the Nullstellensatz fails in this case.
It is then natural to ask on which topological space \( \faktor{\mathbb R[X, Y]}{(X^2 + Y^2 + 1)} \) is naturally the set of functions.
Similar questions can be asked about \( \mathbb Z \) or \( \mathbb Z[X] \), for example.

Consider \( C = \mathbb V(Y - X^2) \subseteq \mathbb A^2_k \) and \( D = \mathbb V(Y) \).
Then \( C \cap D = \mathbb V(X^2, Y) = \mathbb V(X, Y) = \qty{(0, 0)} \).
If \( D_\delta = \mathbb V(Y + \delta) \) for \( \delta \in k \), \( C \cap D_\delta \) is two points unless \( \delta = 0 \).
This breaks a continuity property.
Therefore, the intersection of two affine varieties is not naturally an affine variety.

\subsection{Spectrum of a ring}
Let \( A \) be a commutative unital ring.
\begin{definition}
    The \emph{Zariski spectrum} of \( A \) is \( \Spec A = \qty{\mathfrak p \trianglelefteq A \text{ prime}} \).
\end{definition}
\begin{remark}
    Given a ring homomorphism \( \varphi : A \to B \), we have an induced map of sets \( \varphi^{-1} : \Spec B \to \Spec A \) given by \( \mathfrak q \mapsto \varphi^{-1}(\mathfrak q) \), as the preimage of a prime ideal is always prime.
    Note, however, that this property would fail if we only considered maximal ideals, because the preimage of a maximal ideal need not be maximal.
    % TODO: Example

    Given \( f \in A \) and a point \( \mathfrak p \in \Spec A \), we have an induced \( \overline f \in \faktor{A}{\mathfrak p} \) obtained by taking the quotient.
    We can think of this operation as `evaluating' an \( f \in A \) at a point \( \mathfrak p \in \Spec A \), with the caveat that the codomain of this evaluation depends on \( \mathfrak p \).
\end{remark}
\begin{example}
    \begin{enumerate}
        \item Let \( A = \mathbb Z \).
        Then \( \Spec A = \Spec \mathbb Z \) is the set \( \qty{(p) \mid p \text{ prime}} \cup \qty{(0)} \).
        Consider an element of \( \mathbb Z \), say, \( 132 \).
        Given a prime \( p \), we can `evaluate it at \( p \)', giving \( 132 \text{ mod } p \in \faktor{\mathbb Z}{p\mathbb Z} \).
        Thus \( \Spec \mathbb Z \) is a space, \( 132 \) is a function on \( \Spec \mathbb Z \), and \( 132 \text{ mod } p \) is the value of this function at \( p \).
        \item Let \( A = \mathbb R[X] \).
        Then \( \Spec A \) is naturally \( \mathbb C \) modulo complex conjugation, together with the zero ideal.
        \item If \( A = \mathbb C[X] \), then \( \Spec A \) is naturally \( \mathbb C \), together with the zero ideal.
    \end{enumerate}
\end{example}
\begin{definition}
    Let \( f \in A \).
    Then we define
    \[ \mathbb V(f) = \qty{\mathfrak p \in \Spec A \mid f = 0 \text{ mod } \mathfrak p \text{, or equivalently, } f \in \mathfrak p} \subseteq \Spec A \]
    Similarly, for \( J \trianglelefteq A \) an ideal,
    \[ \mathbb V(J) = \qty{\mathfrak p \in \Spec A \mid \forall f \in J,\, f \in \mathfrak p} = \qty{\mathfrak p \in \Spec A \mid J \subseteq \mathfrak p} \]
\end{definition}
\begin{proposition}
    The sets \( \mathbb V(J) \subseteq \Spec A \) ranging over all ideals \( J \trianglelefteq A \) form the closed sets of a topology.
\end{proposition}
This topology is called the \emph{Zariski topology} on \( A \).
\begin{proof}
    We have \( \varnothing = \mathbb V(1) \) and \( \Spec A = \mathbb V(0) \), so they are closed.
    Note that
    \[ \mathbb V\qty(\sum_\alpha I_\alpha) = \bigcap_\alpha \mathbb V(I_\alpha) \]
    It remains to show \( \mathbb V(I_1) \cup \mathbb V(I_2) = \mathbb V(I_1 \cap I_2) \).
    The containment \( \mathbb V(I_1) \cup \mathbb V(I_2) \subseteq \mathbb V(I_1 \cap I_2) \) is clear.
    Conversely, note \( I_1 I_2 \subseteq I_1 \cap I_2 \).
    If \( I_1 \cap I_2 \subseteq \mathfrak p \), then by primality of \( \mathfrak p \), either \( I_1 \subseteq \mathfrak p \) or \( I_2 \subseteq \mathfrak p \).
\end{proof}
\begin{example}
    Consider \( \Spec \mathbb C[x, y] \).
    The point \( (0) \in \Spec \mathbb C[x, y] \) is dense in the Zariski topology, so \( \overline{\qty{(0)}} = \Spec \mathbb C[x, y] \).
    This is because all prime ideals in integral domains contain the zero ideal.
    \( (0) \) is sometimes called the \emph{generic point}.

    Consider the prime ideal \( (y^2 - x^3) \), and consider a maximal ideal \( \mathfrak m_{a,b} = (x - a, y - b) \) corresponding to the point \( (a, b) \).
    Then one can show that
    \[ \mathfrak m_{a,b} \in \overline{\qty{(y^2 - x^3)}} \iff b^2 = a^3 \]
    In general, points are not closed.
\end{example}

\subsection{Distinguished opens and localisation}
\begin{definition}
    Let \( f \in A \).
    Define the \emph{distinguished open} corresponding to \( f \) to be
    \[ U_f = \Spec A \setminus \mathbb V(f) \]
\end{definition}
\begin{example}
    \begin{enumerate}
        \item Let \( A = \mathbb C[x] \), and recall that \( \Spec A \) is \( \mathbb C \cup \qty{(0)} \), where the complex number \( a \) represents the maximal ideal \( (x - a) \).
        Let \( f = x \) and consider
        \[ \mathbb V(x) = \qty{\mathfrak p \mid x \in \mathfrak p} = \qty{(x)} \]
        Hence \( U_x = \Spec A \setminus \qty{(x)} \), which is \( \Spec A \) without the complex number 0.
        \item More generally, suppose we fix \( a_1, \dots, a_r \in \mathbb C \).
        Then
        \[ U = \Spec A \setminus \qty{(x - a_i)}_{i=1}^r = U_f;\quad f = \prod_{i=1}^r (x-a_i) \]
    \end{enumerate}
\end{example}
\begin{lemma}
    The distinguished opens \( U_f \), taken over all \( f \in A \), form a basis for the Zariski topology on \( \Spec A \); that is, every open set in \( \Spec A \) is a union of some collection of the \( U_f \).
\end{lemma}
\begin{proof}
    Let \( U = \Spec A \setminus \mathbb V(J) \) be an open set.
    Then
    \[ \mathbb V(J) = \mathbb V\qty(\sum_{f \in J} (f)) = \bigcap_{f \in J} \mathbb V(f) \]
    So
    \[ U = \bigcup_{f \in J} U_f \]
\end{proof}
\begin{definition}
    Let \( f \in A \).
    The \emph{localisation} of \( A \) at \( f \) is
    \[ A_f = \faktor{A[x]}{(xf - 1)} \]
\end{definition}
Informally, we adjoin \( \frac{1}{f} \) to \( A \).
\begin{lemma}
    The distinguished open \( U_f \subseteq \Spec A \) is naturally homeomorphic to \( \Spec A_f \) via the ring homomorphism \( j : A \to A_f \).
\end{lemma}
\begin{proof}
    We will exhibit a bijection between the prime ideals in \( A_f \) and the prime ideals in \( A \) that do not contain \( f \), producing a homeomorphism as required.
    Given \( \mathfrak q \subseteq A_f \) prime, its contraction \( j^{-1}(\mathfrak q) \) is a prime ideal in \( A \).

    Now suppose \( \mathfrak p \subseteq A \) is a prime ideal, and let \( \mathfrak p_f = j(\mathfrak p) \cdot A_f \).
    We show that \( j(\mathfrak p) \cdot A_f \) is a prime ideal if and only if \( f \notin \mathfrak p \), giving the result.
    If \( f \in \mathfrak p \), then the unit \( f \) lies in \( \mathfrak p_f \).
    Thus \( \mathfrak p_f = (1) \), so is not prime.
    If \( f \notin \mathfrak p \), observe that
    \[ \faktor{A_f}{\mathfrak p_f} \cong \qty(\faktor{A}{\mathfrak p})_{\overline f};\quad \overline f = f + \mathfrak p \]
    But then,
    \[ \qty(\faktor{A}{\mathfrak p})_{\overline f} \subseteq FF\qty(\faktor{A}{\mathfrak p}) \]
    Since \( \mathfrak p \) is prime, \( \faktor{A}{\mathfrak p} \) is an integral domain, so its fraction field is well-defined.
    So \( \mathfrak p_f \) is a prime ideal.
    One can then check that our two constructions are inverse to each other, providing a bijection between prime ideals as required.
\end{proof}
\begin{remark}
    \begin{enumerate}
        \item \( U_f \cap U_g = U_{fg} \).
        Indeed, if \( \mathfrak p \in U_{fg} \), then \( fg \notin \mathfrak p \), so clearly neither \( f \) nor \( g \) can lie in \( \mathfrak p \); conversely, if \( \mathfrak p \in U_f \cap U_g \), then \( f \notin \mathfrak p \) and \( g \notin \mathfrak p \), so by primality, \( fg \notin \mathfrak p \).
        \item The distinguished opens \( U_f \) do not uniquely define an element \( f \in A \).
        For instance, one can easily show that \( U_{f^n} = U_f \) for all \( n \geq 1 \), using the properties of prime ideals.
        \item In line with (ii), the localisations \( A_f \) and \( A_{f^n} \) are homeomorphic in a natural way.
        If
        \[ A_f = \faktor{A[x]}{(xf - 1)};\quad A_{f^n} = \faktor{A[y]}{(yf^n - 1)} \]
        then consider the inverse \( A \)-algebra homomorphisms given by
        \[ x \mapsto f^{n-1} y;\quad y \mapsto x^n \]
        Informally, we map \( \frac{1}{f} \) to \( f^{n-1} \frac{1}{f^n} \), and \( \frac{1}{f^n} \) to \( \qty(\frac{1}{f})^n \).
        \item The containment \( U_f \subseteq U_g \) holds if and only if \( f^n \) is a multiple of \( g \) for some \( n \geq 1 \).
        First, if \( f^n \) is a multiple of \( g \), then the claim holds by (i).
        Now suppose \( U_f \subseteq U_g \), so \( \mathbb V(f) \supseteq \mathbb V(g) \).
        Hence, all prime ideals that contain \( g \) also contain \( f \).
        But since
        \[ \sqrt{I} = \bigcap_{\mathfrak p \text{ prime} \supseteq I} \mathfrak p \]
        we must have
        \[ \sqrt{(f)} \supseteq \sqrt{(g)} \]
        giving the result.
    \end{enumerate}
\end{remark}
\begin{remark}
    For a fixed ring \( A \), we have made an assignment
    \[ \qty{\text{distinguished opens in } \Spec A} \to \mathbf{Rng} \]
    given by \( U_f \mapsto A_f \), where \( \mathbf{Rng} \) denotes the class of rings.
    This association is functorial: if \( U_{f_1} \subseteq U_{f_2} \), there is a natural map \( A_{f_2} \to A_{f_1} \), which should be viewed as the restriction map from functions defined on \( U_{f_2} \) to those defined on \( f_1 \).
    This produces a \emph{sheaf}; we now explore these in more generality.
\end{remark}
